package com.freewater.springboot.demo.aop.advice.order.diffaspectclass;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;

@Aspect
@Order(2)
public class Aspect1 {

    @Pointcut("execution(* com.freewater.springboot.demo.aop.advice.order.SomeBusiness+.*(..))")
    public void someBusiness() {

    }

    @Before("someBusiness() && args(data)")
    public void beforeAdvice1(String data) {
        System.out.println("beforeAdvice1 data: " + data);
    }

    @After("someBusiness() && args(data)")
    public void afterAdvice1(String data) {
        System.out.println("afterAdvice1 data: " + data);
    }
}
